from panther_github_helpers import github_alert_context


def rule(event):
    if event.get("action") == "repository_vulnerability_alert.dismiss":
        return True
    return False


def title(event):
    return f"GitHub Dependabot Vulnerability Dismissed by {event.get('actor')}: {event.get('repo')}"


def alert_context(event):
    context = github_alert_context(event)
    alert_url = (
        f"https://github.com/{event.get('repo')}/security/dependabot/{event.get('alert_number')}"
    )
    return context | {"alert_url": alert_url}
